<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>景区数据处理</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
    crossorigin="anonymous">
  <link href="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/css/fileinput.min.css" rel="stylesheet">
</head>

<body>
  <div class="container">
    <div class="row">
      <input id="input-id" type="file" class="file" data-preview-file-type="text">
    </div>
    <div class="row">
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>#</th>
            <th>文件名</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          {% for f in list %}
          <tr>
            <th scope="row">{{f.id}}</th>
            <td>{{f.filename}}</td>
            <td>
              {% if f.status === 2 %}
              <a href="{{'/index/sceniclist?id=' + f.id}}">查看</a>
              {% else %}
              正在处理文件
              {% endif %}
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
    crossorigin="anonymous"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/plugins/piexif.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/plugins/sortable.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.0/js/plugins/purify.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/fileinput.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/themes/fa/theme.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.3.1/js/fileinput_locale_zh.js"></script>
  <script>
    $("#input-id").fileinput({
      uploadUrl: "/index/fileupload",
      showDrag: false,
    });
    $("#input-id").on("fileuploaded", function (event, data, previewId, index) {
      location.reload();
    });
  </script>
</body>

</html>